/**
 * 
 */
package STUDENTS.TRANVANCHO.Sources.EXCER;

import java.util.Scanner;

public class Giai_phuong_trinh_bac_2 {

	public static void main(String[] args) {
		double a,b,c,x1,x2;
		double Delta;
		Scanner sc=new Scanner(System.in);
		System.out.println("nhap gia tri cho a:");
		a=sc.nextFloat();
		System.out.println("nhap gia tri cho b:");
		b=sc.nextFloat();
		System.out.println("nhap gia tri cho c:");
		c=sc.nextFloat();
		if(a==0){
			if (b==0){
				if (c==0){
					System.out.println("phuong trinh vo nghiem");
				}
			}
		else { x1=(-b)/a;
		System.out.println("phuong trinh co nghiem duy nhat");
		}
			else {
				Delta=Math.pow(b, 2)-(4*a*c);
				if 
				(Delta<0)
				{ System.out.println("phuong trinh vo nghiem");
				}
				if (Delta==0)
				{ x1=(-b)/(2*a);
				System.out.println("phuong trinh co nghiem duy nhat");
				}
				else {
					if (Delta>0)
				{
						x1=(-b+Math.sqrt(Delta))/(2*a);
						x2=(-b-Math.sqrt (Delta)/(2*a);
					System.out.println("phuong trinh co hai nghiem");
				
				}
				
				
					
		
		}
}
				
			
				
		}
	}

}
